package com.ez.supervise.model.dto;

import java.util.HashMap;
import java.util.Map;

import com.ez.supervise.model.sys.User;
import com.ez.supervise.util.JsonUtils;

public class LoginUser {
    private Long userId;
    private String loginId;// 登录ID
    private String userName;// 用户姓名
    private Long orgId;// 关联到表SYS_DEPARTMENT的id
    private String orgName;
    private String isManager; // 是否管理者
    private String isDemocracy; // 是否民主评议员：y:是民主评议员，n：不是
    private Long democracyId; // 民主评议员类型id
    private boolean isLogin = true;
    
    private Map mainMemuMap = new HashMap<String,String>();
    private Map memuMap = new HashMap<String,String>();
    
    public LoginUser() {
	 
    }
    
    
    public LoginUser(Long userId,String loginId, Long orgId, String userName) {
	super();
	this.loginId = loginId;
	this.orgId = orgId;
	this.userId = userId;
	this.userName = userName;
    }
    public LoginUser(User user) {
	if (user != null) {
	    this.userId = user.getId();
	    this.orgId = user.getOrgId();
	    this.loginId = user.getLoginId();
	    this.userName = user.getUserName();
	    this.isDemocracy = user.getIsDemocracy();
	    this.isManager = user.getIsManager();
	    this.democracyId = user.getDemocracyId();
	}
    }

    public Long getUserId() {
        return userId;
    }


    public void setUserId(Long userId) {
        this.userId = userId;
    }


    public String getLoginId() {
        return loginId;
    }


    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }


    public String getUserName() {
        return userName;
    }


    public void setUserName(String userName) {
        this.userName = userName;
    }


    public Long getOrgId() {
        return orgId;
    }


    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }


    public String getOrgName() {
        return orgName;
    }


    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }


    public String getIsManager() {
        return isManager;
    }


    public void setIsManager(String isManager) {
        this.isManager = isManager;
    }


    public String getIsDemocracy() {
        return isDemocracy;
    }


    public void setIsDemocracy(String isDemocracy) {
        this.isDemocracy = isDemocracy;
    }


    public Long getDemocracyId() {
        return democracyId;
    }


    public void setDemocracyId(Long democracyId) {
        this.democracyId = democracyId;
    }


    public boolean isLogin() {
        return isLogin;
    }


    public void setLogin(boolean isLogin) {
        this.isLogin = isLogin;
    }


    public Map getMainMemuMap() {
        return mainMemuMap;
    }


    public void setMainMemuMap(Map mainMemuMap) {
        this.mainMemuMap = mainMemuMap;
    }


    public Map getMemuMap() {
        return memuMap;
    }


    public void setMemuMap(Map memuMap) {
        this.memuMap = memuMap;
    }

    public String toJsonString(){
	try {
	    return JsonUtils.fromObject(this, new String[]{"mainMemuMap","memuMap"}).toString();
	} catch (Exception e) {
	    return "{" + "userId:" + this.userId + "}";
	}
    }


}
